import Vue from "vue"
import VueRouter from "vue-router"
import Home from '../views/home.vue'
import User from '../views/user.vue'
import Main from '../views/main'
import Mall from '../views/Mall'
import PageOne from '../views/PageOne'
import PageTwo from '../views/PageTwo'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        redirect: '/home',
        component: Main,
        children: [
            { path: 'home', component: Home },
            { path: 'user', component: User },
            { path: 'mall', component: Mall },
            { path: 'page1', component: PageOne },
            { path: 'page2', component: PageTwo },
        ]
    },

]

const router = new VueRouter({
    routes
})


export default router